package com.aizuda.security.example;

import com.baomidou.kisso.common.encrypt.RSA;

import java.security.Key;
import java.util.Map;

public class RsaKeyGenerator {

    public static void main(String[] args) throws Exception {
        Map<String, Key> keyMap = RSA.genKeyPair();
        String publicKey = RSA.getPublicKey(keyMap);
        String privateKey = RSA.getPrivateKey(keyMap);
        // System.err.println("Base64 公钥: \n\r" + RSA.getBase64PublicKey(keyMap));
        // System.err.println("Base64 私钥： \n\r" + RSA.getBase64PrivateKey(keyMap));
        System.err.println("公钥: \n\r" + publicKey);
        System.err.println("私钥： \n\r" + privateKey);
    }
}
